package org.csmz.class2333.collection;
import java.util.LinkedList;

public class Example02 {
    public static void main(String[] args){
        LinkedList list = new LinkedList();
        list.add("Tuesday");
        list.add("Wednesday");
        list.add("Friday");
        list.add("Saturday");
        System.out.println("在list集合中添加4个元素："+list);
        list.addFirst("Monday");
        System.out.println("将Monday插入list集合开头："+list);
        list.addLast("Sunday");
        System.out.println("将Sunday插入list集合的结尾："+list);
        System.out.println("list获取的第一个元素为："+list.getFirst());
        System.out.println("list获取的最后一个元素为："+list.getLast());
        System.out.println("移除list集合的第一个元素："+list.removeFirst());
        System.out.println("移除后的集合为"+list);

    }
}
